package com.ifacebox.arcsoft.face;

import org.apache.commons.pool2.impl.GenericObjectPool;
import org.springframework.boot.ApplicationArguments;
import org.springframework.boot.ApplicationRunner;
import org.springframework.stereotype.Component;

import javax.annotation.Resource;

/**
 * @author znn
 */
@Component
public class ArcSoftFaceApplicationRunner implements ApplicationRunner {
    @Resource
    private ArcSoftFaceConfigProperties faceConfigProperties;
    @Resource
    private GenericObjectPool<ArcSoftFaceEngine> faceEnginePool;

    @Override
    public void run(ApplicationArguments args) throws Exception {
        faceEnginePool.addObjects(faceConfigProperties.getFaceMaxThreads());
    }
}